﻿@model qltscd.Models.BaseClient.DanhMucNguoiDung
@{
    ViewBag.Title = "SuaNguoiDung";
    Layout = "~/Views/Shared/Modules/_LayoutHeThong.cshtml";
}

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script>
    function submitTaoNguoiDung(kieu) {
        document.getElementById("kieu").value = kieu;
        document.forms["TaoNguoiDung"].submit();
    }
</script>

@using (Html.BeginForm("SuaNguoiDung", "DanhMucNguoiDung", FormMethod.Post, new { @id = "TaoNguoiDung" })) 
{
    @Html.ValidationSummary(true);
    @Html.HiddenFor(o=>o.IdentityNguoiDung)
    <input type="hidden" value="0" name="kieu" id="kieu"/>                            
    <fieldset>
    <legend>Danh Mục Người Dùng</legend>
        <table border="0" width="100%" cellpadding="10px" cellspacing="10px">
        <tr>
            <td style="margin-left: 10px;" class="label_col">
                Mã
            </td>
            <td>
                @Html.TextBoxFor(model => model.MaNguoiDung, new { @style = "width:97%; "})
                
            </td>

            <td style="margin-left: 10px;" class="label_col">
                Tên người dùng
            </td>
            <td>
                @Html.TextBoxFor(model => model.TenNguoiDung, new { @style = "width:97%; " })
                
            </td>
        </tr>
        <tr>
            <td style="margin-left: 10px;" class="label_col">
                Họ tên đệm
            </td>
            <td>
                @Html.TextBoxFor(model => model.HoTenDem, new { @style = "width:97%; "})
                
            </td>

            <td style="margin-left: 10px;" class="label_col">
                Tên người dùng
            </td>
            <td>
                @Html.TextBoxFor(model => model.TenNguoiDung, new { @style = "width:97%; " })
                
            </td>
        </tr>
        <tr>
            <td style="margin-left: 10px;" class="label_col">
                Tên đăng nhập
            </td>
            <td>
                @Html.TextBoxFor(model => model.TenDangNhap, new { @style = "width:97%; " })
                
            </td>

            <td style="margin-left: 10px;" class="label_col">
                Mật khẩu
            </td>
            <td>
                @Html.PasswordFor(model => model.MatKhau, new { @style = "width:97%; " })
                
            </td>
        </tr>
        <tr>
            <td style="margin-left: 10px;" class="label_col">
                Hộp Thư
            </td>
            <td>
                @Html.TextBoxFor(model => model.HopThu, new { @style = "width:97%;" })
                
            </td>
            <td style="margin-left: 10px;" class="label_col">
                Nhập lại mật khẩu
            </td>
            <td>
                @Html.PasswordFor(model => model.XacNhanMatKhau, new { @style = "width:97%;" })
                
            </td>
        </tr>
        <tr>
            <td style="margin-left: 10px;" class="label_col">
                Nhóm người dùng
            </td>
            <td>
                @(Html.Telerik().ComboBox()
                    .Name("IdentityNhomNguoiDung")
                    .HtmlAttributes(new { @style = "width:97%;" })
                    .BindTo((SelectList)ViewBag.IdentityNhomNguoiDung)
                )
               
            </td>

            <td style="margin-left: 10px;" class="label_col">
                Đơn vị quản lý
            </td>
            <td>
                @(Html.Telerik().ComboBox()
                    .Name("IdentityDonVi")
                    .HtmlAttributes(new { @style = "width:97%;" })
                    .BindTo((SelectList)ViewBag.IdentityDonVi)
                )
                
            </td>
        </tr>
        </table>
    </fieldset>
    <div class="divButton">
            <input type="submit" value="Lưu" class="button" />&nbsp;
            <input type="reset" value="Nhập lại" class="button" />&nbsp;
            @Html.ActionLink("Thoát", "Index", null, new { @class = "button" })
        </div>
}
@*<div>
    @Html.ActionLink("Back to List", "Index")
</div>*@
 <div class="errBlock">
                @Html.ValidationMessageFor(model => model.MaNguoiDung, "", new { @style = "display:block" })

                        @ViewData[qltscd.Contansts.SessionConstants.ERROR_MESSAGE]
                    <br />
                                     @Html.ValidationMessageFor(model => model.HoTenDem, "", new { @style = "display:block" })
                    
                      @Html.ValidationMessageFor(model => model.TenNguoiDung, "", new { @style = "display:block" })
                     
                                  @Html.ValidationMessageFor(model => model.TenDangNhap, "", new { @style = "display:block" })
                     
                                     @Html.ValidationMessageFor(model => model.MatKhau, "", new { @style = "display:block" })
                     
                      @Html.ValidationMessageFor(model => model.HopThu, "", new { @style = "display:block" })
                     
                                     @Html.ValidationMessageFor(model => model.XacNhanMatKhau, "", new { @style = "display:block" })
                     
                     @Html.ValidationMessageFor(model => model.IdentityNhomNguoiDung, "", new { @style = "display:block" })
                     
                     @Html.ValidationMessageFor(model => model.IdentityDonVi, "", new { @style = "display:block" })
                     </div>